$(function(){
		var time=0;

		$('.post-audit').click(function(event){
				target=$(event.target);
				if (time == 0) {
			        time = 2; //设定间隔时间（秒）
			 
			        //启动计时器，倒计时time秒后自动关闭计时器。
			        var index = setInterval(function(){
			            time--;
			            if (time == 0) {
			                clearInterval(index);
			            }
			        }, 1000);
						    var post_id=target.attr('post-id');
							var status=target.attr('post-action-status');
							 console.log(post_id);
							  console.log(status);

							 $.ajaxSetup({
								    headers: {
								        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
								    }
								});	
							 $.ajax({
							  		url:'/admin/'+post_id+'/store',
							  		dataType:"json",
							  		method:'POST',
							  		data:{'status':status},
							  		success:function(data){
							   				console.log(data.error);
							   				return ;
							 		 }
				  				});
							 target.parent().parent().remove();
								
			       
			    }else{
			        alert('请不要点击过快');
			    }
				

		});
	




});